"""
-*- coding:utf-8 -*-
__project_ = PyCharm Community Edition
__file_name__ = SEday3
__author__ = 'WangYulin'
__time__ = 2020/12/25 13:52
__product_name = PyCharm Community Edition
# code is far away from bugs with the god animal protecting
    I love animals. They taste delicious.
"""
from selenium import webdriver
from time import sleep
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
import os


class Testcase(object):
    def __init__(self):
        self.browser = webdriver.Chrome()
        self.browser.get("https://www.baidu.com/")
        self.browser.maximize_window()
        sleep(1)

    def test_all(self):
        self.browser.find_element(By.ID, value="kw").send_keys("今天是圣诞节")
        sleep(1)
        self.browser.find_element_by_link_text('百度首页').click()
        sleep(1)
        self.browser.quit()


if __name__ == '__main__':
    Testcase().test_all()
